Skip to content

Stack/05 npc ai combat#372

Merged
BoroBongo merged 6 commits into
mainfrom
stack/05-npc-ai-combat
Jun 17, 2026
Merged

Stack/05 npc ai combat#372
BoroBongo merged 6 commits into
mainfrom
stack/05-npc-ai-combat

Conversation

@JucanAndreiDaniel

@JucanAndreiDaniel JucanAndreiDaniel commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Summary

NPC AI, routine, weapon and melee-combat overhaul. Removes the standalone routine service in favour of the NPC services and fills in weapon draw/undraw plus hit detection.

Changes

  • Routine removal — deletes RoutineService/RoutineHandler and their Reflex registration.
  • Routine + AI — scheduling/progression moved into NpcRoutineService, NpcAiService, NpcService, NpcHelperService, wired through BootstrapService.
  • WeaponsAiDrawWeapon/UndrawWeapon actions using the real 1h/2h/Mag animation prefixes, plus the backing VM externals and enums.
  • CombatAttack hit detection gated on DEF_OPT_FRAME with the G1 damage formula; FightService clears the queued action list on death so corpses don't play out pending animations; AiHandler updates.
  • Action sequencing — fixes to walk/turn/use-mob actions: GoToFp orphan-walk slide, UseMob slot tags with stepwise stop, and turn/walk transitions.

How to test

  • Confirm NPCs follow daily routines (walk between waypoints, use mobs/benches).
  • Draw and undraw 1h/2h/magic weapons and confirm the correct animations play.
  • Engage in melee: confirm hits only register inside the attack frame window and damage matches the G1 formula.
  • Kill an NPC mid-action and confirm the corpse doesn't finish queued animations.

Not fixed

  • combat for human NPCs doesn't work

@JucanAndreiDaniel JucanAndreiDaniel self-assigned this Jun 13, 2026
@JucanAndreiDaniel JucanAndreiDaniel added the improvement Optimize an existing feature label Jun 13, 2026
Base automatically changed from stack/04-culling to main June 15, 2026 04:41
Routine scheduling moves into the NPC services; drops their Reflex registration.
Routine lookup/progression and AI ticking now live in the NPC services, wired through BootstrapService.
Adds AiDrawWeapon/UndrawWeapon actions using 1h/2h/Mag prefixes and the backing VM externals/enums.
Implements DEF_OPT_FRAME-gated attacks, the G1 damage formula, and clears the queued actions on death so corpses do not finish pending animations.
Fixes GoToFp orphan-walk slide, UseMob slot tags with stepwise stop, and turn/walk action transitions.
@JucanAndreiDaniel JucanAndreiDaniel marked this pull request as ready for review June 15, 2026 04:47

@BoroBongo BoroBongo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conflicts resolved: GlobalVictim fix, BodyState reset in ExtAiStandUp, walk animation caching + BodyState tracking combined, UseMob null check idiom.

@BoroBongo BoroBongo merged commit e5fa207 into main Jun 17, 2026
@BoroBongo BoroBongo deleted the stack/05-npc-ai-combat branch June 17, 2026 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Optimize an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants